
from fastapi import  Request
from scorpio.services.database import DatabaseInitializerService
from scorpio.core.database import VectorDatabaseManager
from scorpio.core.common import EmbeddingConfig, ScorpioConfig



# 定义依赖函数，用于获取db_initializer
def get_db_initializer(request: Request)->DatabaseInitializerService:
    return request.app.state.db_initializer

def get_db_manager(request: Request)->VectorDatabaseManager:
    return request.app.state.db_manager

def get_embedding_config(request: Request)->EmbeddingConfig:
    return request.app.state.config.embedding

def get_config(request: Request)->ScorpioConfig:
    return request.app.state.config
